//
//  LSZNewAlbumPlaybackInterfaceTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/5/24.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZNewAlbumPlaybackInterfaceTableViewCell.h"

@implementation LSZNewAlbumPlaybackInterfaceTableViewCell

#pragma mark - 类似网易专辑播放的头
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.viewTopBack = [[UIView alloc]init];
        self.viewTopBack.backgroundColor = RGBColor(46, 49, 54);
        [self addSubview:self.viewTopBack];

        self.coverImageView = [[UIImageView alloc] init];
        self.coverImageView.contentMode = UIViewContentModeScaleAspectFill;
        self.coverImageView.clipsToBounds = YES;
        self.coverImageView.userInteractionEnabled = YES;
        [self.viewTopBack addSubview:self.coverImageView];

        self.albumLabel = [[UILabel alloc]init];
        self.albumLabel.textColor = RGBColor(156, 156, 156);
        [LSZSpecialPackaging setLabel_14_5_Size:self.albumLabel];
        [self.viewTopBack addSubview:self.albumLabel];

        self.labelName = [[UILabel alloc]init];
        self.labelName.textColor = RGBColor(156, 156, 156);
        [LSZSpecialPackaging setLabel_14_5_Size:self.labelName];
        [self.viewTopBack addSubview:self.labelName];

        self.labelIntroduction = [[UILabel alloc]init];
        self.labelIntroduction.textColor = RGBColor(156, 156, 156);
        self.labelIntroduction.numberOfLines = 2;
        [LSZSpecialPackaging setLabel_14_5_Size:self.labelIntroduction];
        [self.viewTopBack addSubview:self.labelIntroduction];

        self.butPreview = [[UIButton alloc]init];
        [self.viewTopBack addSubview:self.butPreview];

        self.imageViewPreview = [[UIImageView alloc]init];
        self.imageViewPreview.image = [UIImage imageNamed:@"浏览"];
//        imageViewPreview.backgroundColor = [UIColor yellowColor];
        [self.butPreview addSubview:self.imageViewPreview];

        self.labelPreview = [[UILabel alloc]init];
        self.labelPreview.textAlignment = NSTextAlignmentCenter;
        self.labelPreview.textColor = [UIColor whiteColor];
        [LSZSpecialPackaging setLabel_14_5_Size:self.labelPreview];
//        self.labelPreview.backgroundColor = [UIColor yellowColor];
        [self.butPreview addSubview:self.labelPreview];

        self.butCollection = [[UIButton alloc]init];
        [self.viewTopBack addSubview:self.butCollection];

        self.imageViewCollection = [[UIImageView alloc]init];
        self.imageViewCollection.image = [UIImage imageNamed:@"收藏收藏"];
        [self.butCollection addSubview:self.imageViewCollection];

        self.labelCollection = [[UILabel alloc]init];
        self.labelCollection.textAlignment = NSTextAlignmentCenter;
        self.labelCollection.text = @"收藏";
        self.labelCollection.textColor = [UIColor whiteColor];
        [LSZSpecialPackaging setLabel_14_5_Size:self.labelCollection];
        [self.butCollection addSubview:self.labelCollection];

        self.butGiveLike = [[UIButton alloc]init];
        [self.viewTopBack addSubview:self.butGiveLike];

        self.imageViewGiveLike = [[UIImageView alloc]init];
        self.imageViewGiveLike.image = [UIImage imageNamed:@"点赞点赞"];
        [self.butGiveLike addSubview:self.imageViewGiveLike];
        
        self.labelGiveLike = [[UILabel alloc]init];
        self.labelGiveLike.textAlignment = NSTextAlignmentCenter;
        self.labelGiveLike.textColor = [UIColor whiteColor];
        [LSZSpecialPackaging setLabel_14_5_Size:self.labelGiveLike];
        [self.butGiveLike addSubview:self.labelGiveLike];

        if (ScreenWidth == 320) {
            //5
            self.viewTopBack.frame =CGRectMake(0, 0, ScreenWidth, 270-NAVIGATION_BAR_HEIGHT);
            self.coverImageView.frame = CGRectMake(20,15, 120, 120);
            self.coverImageView.backgroundColor = [UIColor yellowColor];
            self.albumLabel.frame = CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+15+2, CGRectGetMinY(self.coverImageView.frame)+5, ScreenWidth-CGRectGetMaxX(self.coverImageView.frame)-20,16);
            self.labelName.frame = CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+15+2, CGRectGetMaxY(self.albumLabel.frame)+20, ScreenWidth-CGRectGetMaxX(self.coverImageView.frame)-20, 16);
            self.labelIntroduction.frame = CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+15+2, CGRectGetMaxY(self.labelName.frame)+20, ScreenWidth-CGRectGetMaxX(self.coverImageView.frame)-20,45);
            //浏览
            self.butPreview.frame = CGRectMake(10,CGRectGetMaxY(self.coverImageView.frame), (ScreenWidth-20)/3, self.viewTopBack.frame.size.height-CGRectGetMaxY(self.coverImageView.frame));
            self.imageViewPreview.frame = CGRectMake((self.butPreview.frame.size.width-24)/2,(self.butPreview.frame.size.height-24-5-16)/2, 24, 24);
            self.labelPreview.frame = CGRectMake(0, CGRectGetMaxY(self.imageViewPreview.frame)+5,self.butPreview.frame.size.width, 16);
            //收藏
            self.butCollection.frame = CGRectMake(10+(ScreenWidth-20)/3,CGRectGetMaxY(self.coverImageView.frame), (ScreenWidth-20)/3, self.viewTopBack.frame.size.height-CGRectGetMaxY(self.coverImageView.frame));
            self.imageViewCollection.frame = CGRectMake((self.butCollection.frame.size.width-24)/2,(self.butPreview.frame.size.height-24-5-16)/2, 24, 24);
            self.labelCollection.frame = CGRectMake(0, CGRectGetMaxY(self.imageViewCollection.frame)+5,self.butCollection.frame.size.width, 16);
            //点赞
            self.butGiveLike.frame = CGRectMake(10+(ScreenWidth-20)/3*2,CGRectGetMaxY(self.coverImageView.frame), (ScreenWidth-20)/3, self.viewTopBack.frame.size.height-CGRectGetMaxY(self.coverImageView.frame));
            self.imageViewGiveLike.frame = CGRectMake((self.butGiveLike.frame.size.width-24)/2, (self.butGiveLike.frame.size.height-24-5-16)/2, 24, 24);
            self.labelGiveLike.frame = CGRectMake(0, CGRectGetMaxY(self.imageViewGiveLike.frame)+5,self.butGiveLike.frame.size.width, 16);
        }else if(ScreenWidth == 375){
            // 6 7
            if (iPhoneX) {
                self.viewTopBack.frame =CGRectMake(0, 0, ScreenWidth, 280+24-NAVIGATION_BAR_HEIGHT);
            }else{
                self.viewTopBack.frame =CGRectMake(0, 0, ScreenWidth, 280-NAVIGATION_BAR_HEIGHT);
            }
            self.coverImageView.frame = CGRectMake(20,15, 130, 130);
            self.albumLabel.frame = CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+15+2, CGRectGetMinY(self.coverImageView.frame)+6, ScreenWidth-CGRectGetMaxX(self.coverImageView.frame)-20,18);
            self.labelName.frame = CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+15+2, CGRectGetMaxY(self.albumLabel.frame)+20, ScreenWidth-CGRectGetMaxX(self.coverImageView.frame)-20, 18);
            self.labelIntroduction.frame = CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+15+2, CGRectGetMaxY(self.labelName.frame)+20, ScreenWidth-CGRectGetMaxX(self.coverImageView.frame)-20,45);

            self.butPreview.frame = CGRectMake(10,CGRectGetMaxY(self.coverImageView.frame), (ScreenWidth-20)/3, self.viewTopBack.frame.size.height-CGRectGetMaxY(self.coverImageView.frame));
            self.imageViewPreview.frame = CGRectMake((self.butPreview.frame.size.width-25)/2,(self.butPreview.frame.size.height-25-5-17)/2, 25, 25);
            self.labelPreview.frame = CGRectMake(0, CGRectGetMaxY(self.imageViewPreview.frame)+5,self.butPreview.frame.size.width, 17);
            //收藏
            self.butCollection.frame = CGRectMake(10+(ScreenWidth-20)/3,CGRectGetMaxY(self.coverImageView.frame), (ScreenWidth-20)/3, self.viewTopBack.frame.size.height-CGRectGetMaxY(self.coverImageView.frame));
            self.imageViewCollection.frame = CGRectMake((self.butCollection.frame.size.width-25)/2,(self.butCollection.frame.size.height-25-5-17)/2, 25, 25);
            self.labelCollection.frame = CGRectMake(0, CGRectGetMaxY(self.imageViewCollection.frame)+5,self.butCollection.frame.size.width, 17);
            //点赞
            self.butGiveLike.frame = CGRectMake(10+(ScreenWidth-20)/3*2,CGRectGetMaxY(self.coverImageView.frame), (ScreenWidth-20)/3, self.viewTopBack.frame.size.height-CGRectGetMaxY(self.coverImageView.frame));
            self.imageViewGiveLike.frame = CGRectMake((self.butGiveLike.frame.size.width-25)/2, (self.butGiveLike.frame.size.height-25-5-17)/2, 25, 25);
            self.labelGiveLike.frame = CGRectMake(0, CGRectGetMaxY(self.imageViewGiveLike.frame)+5,self.butGiveLike.frame.size.width, 17);
        }else {
            //plus
            self.viewTopBack.frame =CGRectMake(0, 0, ScreenWidth, 290-NAVIGATION_BAR_HEIGHT);
            self.coverImageView.frame = CGRectMake(20,15, 135, 135);
            self.albumLabel.frame = CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+15+2, CGRectGetMinY(self.coverImageView.frame)+7, ScreenWidth-CGRectGetMaxX(self.coverImageView.frame)-20,20);
            self.labelName.frame = CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+15+2, CGRectGetMaxY(self.albumLabel.frame)+20, ScreenWidth-CGRectGetMaxX(self.coverImageView.frame)-20, 20);
            self.labelIntroduction.frame = CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+15+2, CGRectGetMaxY(self.labelName.frame)+20, ScreenWidth-CGRectGetMaxX(self.coverImageView.frame)-20,45);

            self.butPreview.frame = CGRectMake(10,CGRectGetMaxY(self.coverImageView.frame), (ScreenWidth-20)/3, self.viewTopBack.frame.size.height-CGRectGetMaxY(self.coverImageView.frame));
            self.imageViewPreview.frame = CGRectMake((self.butPreview.frame.size.width-26)/2,(self.butPreview.frame.size.height-26-5-20)/2, 26, 26);
            self.labelPreview.frame = CGRectMake(0, CGRectGetMaxY(self.imageViewPreview.frame)+5,self.butPreview.frame.size.width, 20);
            //收藏
            self.butCollection.frame = CGRectMake(10+(ScreenWidth-20)/3,CGRectGetMaxY(self.coverImageView.frame), (ScreenWidth-20)/3, self.viewTopBack.frame.size.height-CGRectGetMaxY(self.coverImageView.frame));
            self.imageViewCollection.frame = CGRectMake((self.butCollection.frame.size.width-26)/2,(self.butPreview.frame.size.height-26-5-20)/2, 26, 26);
            self.labelCollection.frame = CGRectMake(0, CGRectGetMaxY(self.imageViewCollection.frame)+5,self.butCollection.frame.size.width, 20);
            //点赞
            self.butGiveLike.frame = CGRectMake(10+(ScreenWidth-20)/3*2,CGRectGetMaxY(self.coverImageView.frame), (ScreenWidth-20)/3, self.viewTopBack.frame.size.height-CGRectGetMaxY(self.coverImageView.frame));
            self.imageViewGiveLike.frame = CGRectMake((self.butGiveLike.frame.size.width-26)/2, (self.butGiveLike.frame.size.height-26-5-20)/2, 26, 26);
            self.labelGiveLike.frame = CGRectMake(0, CGRectGetMaxY(self.imageViewGiveLike.frame)+5,self.butGiveLike.frame.size.width, 20);
        }
    }
    return self;
}
@end
